<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .fa {
            width: 400px;
            height: 100px;
            background-color: pink;
        }

        .son {
            width: 200px;
            height: 20px;
            background-color: blue;
        }
    </style>
</head>

<body>
    <div class="fa">
        <div class="son"></div>
    </div>
    <script>
        const fa = document.querySelector('.fa')
        const son = document.querySelector('.son')
        son.addEventListener('click', function () {
            console.log('son')
        })
        fa.addEventListener('click', function (e) {
            console.log('fa')
            //阻止事件冒泡 e.stopPropagation()：当fa盒子被点击时，其他不会跳出
            e.stopPropagation()


        })

        document.addEventListener('click', function () {
            console.log('mom')
        })
    </script>


</body>

</html>